<!-- 生产订单 -->
<script lang="ts">
export default {
  name: "productionOrder",
  components: { chooseBom, printProcess, chooseMaterial, customerSelect }
};
</script>
<script setup lang="ts">
import { reactive, ref, nextTick, onMounted } from "vue";
import { changeHeight } from "/@/utils/public.mixin";
import chooseMaterial from "./chooseMaterial.vue"; //弹框选择物料
import customerSelect from "/@/components/select/customer.vue"; //下拉选择客户组件
import {
  VXETable,
  VxeTableInstance,
  VxeFormPropTypes,
  VxeFormInstance,
  VxeToolbarInstance
} from "vxe-table";
import {
  queryProductOrderPage,
  addProducttionOrder,
  updateProducttionOrder,
  querySaleOrderByBnoNo,
  schedulingOrder,
  recall,
  queryOrderPage,
  startProdOrder,
  startProdOrders,
  finishProdOrder,
  suspendProdOrder, //暂停接口
  cancelSuspendProdOrder, //取消
  reportTask, //异常完工
  deletePo //删除单据
} from "/@/api/prm/productionOder";
import chooseBom from "/@/views/basic/bom/chooseBom.vue";
import printProcess from "/@/components/print/processPrint.vue";
import { useRoute } from "vue-router";
import { queryTeamAll } from "/@/api/basic/team";
import { dateFormatYMD } from "/@/utils/date";
import { alertMessage, errorMessage, successMessage } from "/@/utils/message";
import { queryItemByCodes } from "/@/api/basic/dictionaries";

import { loadEnv } from "@build/index";
import { VxeTableEvents } from "vxe-table";
import { queryBomListByBomComId } from "/@/api/basic/bom";
const route = useRoute();
const routeName = route.name as string;
// 加载环境变量 VITE_PROXY_DOMAIN（开发环境）  VITE_PROXY_DOMAIN_REAL（打包后的线上环境）
const { VITE_PROXY_DOMAIN, VITE_PROXY_DOMAIN_REAL } = loadEnv();
const actionUrl =
  process.env.NODE_ENV === "production"
    ? VITE_PROXY_DOMAIN_REAL
    : (VITE_PROXY_DOMAIN as string);
const page = reactive({
  pageNum: 1,
  pageRow: 20,
  totalResult: 0
});

const table = reactive({
  loading: false,
  tableData: [] as any[],
  treeId: "" as any,
  listData: [] as any[],
  selectData: [],
  tableHeight: 0, //表格高度
  listQuery: {
    date: "",
    bnoNo: "",
    prodOrderNo: "",
    taskNo: "",
    planStatus: "" as any, // as any
    runningStatus: "" as any, // as any
    bomCode: "",
    bomName: "",
    topBomCodeOrName: "",
    endWorkdConfimDate: "",
    startWorkConfimDate: ""
  }
});

const xTable = ref({} as VxeTableInstance);
const xForm = ref({} as VxeFormInstance);
const xToolbar = ref({} as VxeToolbarInstance);
// 查询
const searchEvent = () => {
  const data: any = {};
  Object.assign(data, table.listQuery);
  procedure.bnoNo = table.listQuery.bnoNo;
  procedure.bomCode = table.listQuery.bomCode;
  procedure.bomName = table.listQuery.bomName;
  procedure.endWorkdConfimDate = table.listQuery.endWorkdConfimDate;
  procedure.startWorkConfimDate = table.listQuery.startWorkConfimDate;
  procedure.prodOrderNo = table.listQuery.prodOrderNo;
  procedure.taskNo = table.listQuery.taskNo;
  data.bnoNo = table.listQuery.bnoNo;
  data.bomCode = table.listQuery.bomCode;
  data.bomName = table.listQuery.bomName;
  data.prodOrderNo = table.listQuery.prodOrderNo;
  data.taskNo = table.listQuery.taskNo;
  data.pageNum = page.pageNum;
  data.pageRow = page.pageRow;
  if (table.listQuery.date) {
    data.startWorkConfimDate =
      dateFormatYMD(table.listQuery.date[0]) + " 00:00:00";
    data.endWorkdConfimDate =
      dateFormatYMD(table.listQuery.date[1]) + " 23:59:59";
  } else {
    data.startWorkConfimDate = "";
    data.endWorkdConfimDate = "";
  }
  table.loading = true;
  queryProductOrderPage(data)
    .then((res: any) => {
      if (res.code === 0) {
        procedure.tableData = res.data.list;
        page.totalResult = res.data.total;
        table.loading = false;
      }
    })
    .catch(() => {
      table.loading = false;
    });
  nextTick(() => {
    table.loading = false;
  });
};
// 获取新增时的任务编号
const queryOrderEvent = taskNo => {
  const data: any = {};
  data.taskNo = taskNo;
  data.pageNum = page.pageNum;
  data.pageRow = page.pageRow;
  queryOrderPage(data).then((res: any) => {
    procedure.taskNoData = res.data.list;
  });
};

const procedure = reactive({
  addStatus: 0,
  treefigureNumber: "",
  treemodelNumber: "",
  treeAnd: "",
  treeName: "",
  treeCode: "",
  status: 0,
  bnoNo: "",
  bomCode: "",
  bomName: "",
  prodOrderNo: "",
  taskNo: "",
  loading: false,
  submitLoading: false,
  filterName: "",
  selectRow: null,
  selectType: null,
  showEdit: false,
  tableData: [] as any[],
  BnoNoData: [] as any[],
  listData: [] as any[],
  teamData: [] as any[],
  lengthData: [] as any[],
  taskNoData: [] as any[],
  ids: [] as any[], //排产多选保存数组
  startList: [],
  startWorkDate: "",
  endWorkdDate: "",
  endWorkdConfimDate: "",
  startWorkConfimDate: "",
  formData: {
    bnoConfimNum: 0,
    bnoNo: "",
    bomCode: "",
    bomName: "",
    custName: "",
    endWorkdConfimDate: "",
    endWorkdDate: "",
    productDeptName: "",
    startWorkDate: "",
    startWorkConfimDate: "",
    taskNo: "",
    id: 0,
    date: [],
    dateTime: [],
    priceUnit: "件",
    bomComId: 0,
    figureNumber: "",
    modelNumber: ""
  },

  formRules: {
    bnoConfimNum: [{ required: true, message: "请输入数量" }],
    custName: [{ required: true, message: "请选择客户" }],
    taskNo: [{ required: true, message: "请输入任务编号" }],
    bomCode: [{ required: true, message: "请输入料号" }],
    bomName: [{ required: true, message: "请输入品名" }],
    endWorkdConfimDate: [{ required: true, message: "请输入调整后加工日期" }],
    startWorkConfimDate: [{ required: true, message: "请输入调整前加工日期" }]
    // endWorkdDate: [{ required: true, message: "请输入加工日期" }],
    // startWorkDate: [{ required: true, message: "请输加工日期" }]
    // productDeptName: [{ required: true, message: "请输入生产部门" }]
  } as VxeFormPropTypes.Rules,
  formRulesEl: {
    bnoConfimNum: [{ required: true, message: "请输入数量" }],
    bnoNo: [{ required: true, message: "请输入销售单号" }],
    bomCode: [{ required: true, message: "请输入料号" }],
    bomName: [{ required: true, message: "请输入品名" }],
    endWorkdConfimDate: [{ required: true, message: "请输入调整后加工日期" }],
    startWorkConfimDate: [{ required: true, message: "请输入调整前加工日期" }],
    endWorkdDate: [{ required: true, message: "请输入加工日期" }],
    startWorkDate: [{ required: true, message: "请输加工日期" }]
  },
  planState: [
    { label: "未下发", value: "1" },
    { label: "已下发", value: "2" },
    { label: "已撤销", value: "3" },
    { label: "已推送", value: "4" }
  ],
  taskState: [
    { label: "未开始", value: "1" },
    { label: "已完成", value: "2" },
    { label: "暂停", value: "3" },
    { label: "故障", value: "4" },
    { label: "进行中", value: "5" },
    { label: "终止", value: "6" }
  ]
});
// 获取销售单号
const getBnoNo = () => {
  querySaleOrderByBnoNo().then((res: any) => {
    if (res.code === 0) {
      procedure.BnoNoData = res.data;
    }
  });
};
// 生产部门变化
// const teamChange = (id: any) => {
// //   procedure.formData.productDeptId = procedure.teamData.filter(
//     item => item.id == id
//   )[0].id;
// };
// 获取所有班组
const getTeam = () => {
  queryTeamAll().then((res: any) => {
    if (res.code === 0) {
      procedure.teamData = res.data;
    }
  });
};
// 分页发生改变时会触发该事件
const handlePageChange = ({ currentPage, pageSize }) => {
  page.pageNum = currentPage;
  page.pageRow = pageSize;
  searchEvent();
};
// 修改
const editEvent = row => {
  console.log(row, "状态");

  Object.keys(procedure.formData).forEach(key => {
    procedure.formData[key] = row[key] ? row[key] : procedure.formData[key];
  });
  //时间日期赋值
  procedure.formData.dateTime = [
    row.startWorkConfimDate,
    row.endWorkdConfimDate
  ];
  procedure.formData.date = [row.startWorkDate, row.endWorkdDate];

  procedure.selectRow = row;
  procedure.selectType = row.runningStatus;
  procedure.addStatus = row.isSuspend;
  procedure.showEdit = true;
};
// 新增
const insertEvent = () => {
  procedure.selectRow = null;
  procedure.showEdit = true;
};

// 表单提交
const submitEvent = async () => {
  console.log(procedure.formData);
  const $table = xTable.value;
  const $form = xForm.value;
  const errMap = await $form.validate();
  if (!errMap) {
    if (procedure.formData.bnoConfimNum <= 0) {
      errorMessage("数量应大于0");
      return false;
    }
    procedure.formData.startWorkDate =
      dateFormatYMD(procedure.formData.startWorkConfimDate) + " 00:00:00";
    procedure.formData.endWorkdDate =
      dateFormatYMD(procedure.formData.endWorkdConfimDate) + " 23:59:59";
    procedure.formData.startWorkConfimDate =
      dateFormatYMD(procedure.formData.startWorkConfimDate) + " 00:00:00";
    procedure.formData.endWorkdConfimDate =
      dateFormatYMD(procedure.formData.endWorkdConfimDate) + " 23:59:59";
    console.log(procedure.formData);
    if (
      procedure.formData.endWorkdConfimDate >
      procedure.formData.startWorkConfimDate
    ) {
      if (procedure.selectRow) {
        console.log(procedure.selectRow, "神恩");

        procedure.submitLoading = true;
        // 修改
        updateProducttionOrder(procedure.formData)
          .then((res: any) => {
            if (res.code === 0) {
              searchEvent();
              successMessage("保存成功");
              procedure.showEdit = false;
            } else {
              errorMessage(res.message);
            }
            procedure.submitLoading = false;
          })
          .catch(() => {
            errorMessage("操作失败");
            procedure.submitLoading = false;
          });
      } else {
        console.log(nameResult.selectRow);
        // procedure.formData.bomComId = nameResult.selectRow.id;

        // 新增
        addProducttionOrder(procedure.formData)
          .then((res: any) => {
            if (res.code === 0) {
              searchEvent();
              handleClose();
              successMessage("新增成功");
              procedure.showEdit = false;
            } else {
              errorMessage(res.message);
            }
            procedure.submitLoading = false;
          })
          .catch(() => {
            errorMessage("操作失败");
            handleClose();
            procedure.submitLoading = false;
          });
      }
    } else {
      errorMessage("调整后完工日期应大于调整后加工日期");
    }
  }
};
// 排产
const schedulingEvent = async (id: any) => {
  const $table = xTable.value;
  const checkboxRecords = $table.getCheckboxRecords();
  if (checkboxRecords.length == 0) {
    errorMessage("请选择需要排产的生产订单");
    return false;
  } else {
    procedure.ids = [];
    checkboxRecords.map(function (item) {
      procedure.ids.push(item.id);
    });
    scheduling();
  }
};
// 排产提示点确认调的接口
const scheduling = async () => {
  const type = await VXETable.modal.confirm("排产开始后将不能撤回，是否继续?");
  if (type !== "confirm") {
    return;
  }
  schedulingOrder(procedure.ids)
    .then((res: any) => {
      if (res.code == 0) {
        searchEvent();
        successMessage("排产成功");
      } else if (res.code === 10) {
        schedueResult.showEdit = true;
        schedueResult.tableData = res.data;
      } else {
        errorMessage(res.message);
      }
    })
    .catch(() => {
      errorMessage("操作失败");
    });
};
// 排产之后返回code==10绑定的数据
const schedueResult = reactive({
  showEdit: false,
  tableData: [] as any[]
});
// 排产之后返回的结果弹窗关闭事件
const schedueResultClose = () => {
  schedueResult.showEdit = false;
  schedueResult.tableData = [];
  searchEvent();
  handleClose();
};

//暂停
const suspendEvent = async (row: any) => {
  procedure.addStatus = row.isSuspend;
  console.log(procedure.addStatus, "没有");

  const type = await VXETable.modal.confirm("您确定要暂停吗？");
  if (type !== "confirm") {
    return;
  }
  procedure.status = 3;
  suspendProdOrder(row.id, procedure.status)
    .then((res: any) => {
      if (res.code == 0) {
        searchEvent();
        successMessage("暂停成功");
      } else {
        errorMessage(res.message);
      }
    })
    .catch(() => {
      errorMessage("操作失败");
    });
};
//终止
const stopdEvent = async (row: any) => {
  const type = await VXETable.modal.confirm("您确定要终止吗？");
  if (type !== "confirm") {
    return;
  }
  procedure.status = 6;
  suspendProdOrder(row.id, procedure.status)
    .then((res: any) => {
      if (res.code == 0) {
        searchEvent();
        successMessage("终止成功");
      } else {
        errorMessage(res.message);
      }
    })
    .catch(() => {
      errorMessage("操作失败");
    });
};
//取消
const closeEvent = async (row: any) => {
  const type = await VXETable.modal.confirm("您确定要恢复吗？");
  if (type !== "confirm") {
    return;
  }
  procedure.status = 6;
  cancelSuspendProdOrder(row.prodOrderNo)
    .then((res: any) => {
      if (res.code == 0) {
        searchEvent();
        successMessage("恢复成功");
      } else {
        errorMessage(res.message);
      }
    })
    .catch(() => {
      errorMessage("操作失败");
    });
};
//撤回
const recallEvent = async (id: any) => {
  const $table = xTable.value;
  const checkboxRecords = $table.getCheckboxRecords();
  if (checkboxRecords.length == 0) {
    errorMessage("请选择需要撤回的生产订单");
    return false;
  } else {
    procedure.ids = [];
    checkboxRecords.map(function (item) {
      procedure.ids.push(item.id);
    });
    const type = await VXETable.modal.confirm("生产订单撤回后将撤回到计划池?");
    if (type !== "confirm") {
      return;
    }
    recall(procedure.ids)
      .then((res: any) => {
        if (res.code == 0) {
          searchEvent();
          successMessage("撤回成功");
        } else {
          errorMessage(res.message);
        }
      })
      .catch(() => {
        errorMessage("操作失败");
      });
  }
};
const upPlan = () => {
  window.open(
    actionUrl +
      `/production-order/downloadTemplete?bnoNo=${procedure.bnoNo}&bomCode=${procedure.bomCode}&bomName=${procedure.bomName}&&endWorkdConfimDate=${procedure.endWorkdConfimDate}&prodOrderNo=${procedure.prodOrderNo}&startWorkConfimDate=${procedure.startWorkConfimDate}&taskNo=${procedure.taskNo}`
  );
};

// 获取金额货币重量单位
const queryUnit = (code: any) => {
  queryItemByCodes([code]).then((res: any) => {
    procedure.lengthData = res;
  });
};
//开工生产订单
const luckEvent = async row => {
  const type = await VXETable.modal.confirm("您确定要开工吗？");
  if (type !== "confirm") {
    return;
  }
  startProdOrder(row.id)
    .then((res: any) => {
      if (res.code == 0) {
        searchEvent();
        successMessage("开工成功");
      } else {
        errorMessage(res.message);
      }
    })
    .catch(() => {
      errorMessage("操作失败");
    });
};
//批量开工生产订单
const startOrders = async row => {
  const $table = xTable.value;
  const checkboxRecords = $table.getCheckboxRecords();
  if (checkboxRecords.length == 0) {
    errorMessage("请选择需要开工的生产订单");
    return false;
  } else {
    procedure.ids = [];
    checkboxRecords.map(function (item) {
      procedure.ids.push(item.id);
    });
    let temp = checkboxRecords.every(v => {
      if (v.runningStatus == 2) {
        return true;
      } else {
        errorMessage("请选择未开工的生产订单");
        return false;
      }
    });
    if (temp) {
      const type = await VXETable.modal.confirm("您确定要开工吗？");
      if (type !== "confirm") {
        return;
      }
      startProdOrders(procedure.ids)
        .then((res: any) => {
          if (res.code == 0) {
            searchEvent();
            successMessage("操作成功");
          } else {
            errorMessage(res.message);
          }
        })
        .catch(() => {
          errorMessage("操作失败");
        });
    }
  }
};

//完工生产订单
const finishEvent = async row => {
  const type = await VXETable.modal.confirm("您确定要完工吗？");
  if (type !== "confirm") {
    return;
  }
  finishProdOrder(row.id)
    .then((res: any) => {
      if (res.code == 0) {
        searchEvent();
        successMessage("完工成功");
      } else {
        errorMessage(res.message);
      }
    })
    .catch(() => {
      errorMessage("操作失败");
    });
};
// 弹窗选择BOM之后查询物料
const queryBomSelect = (treeId, name) => {
  nameResult.name = name;
  nameResult.loading = true;
  queryBomListByBomComId(treeId)
    .then((res: any) => {
      if (res.code === 0) {
        nameResult.tableData = res.data;
        nextTick(() => xTable.value.setAllTreeExpand(true));
        chooseBomClose();
      }
      nameResult.loading = false;
    })
    .catch(() => {
      errorMessage("查询失败");
      nameResult.loading = false;
    });
};
//品名详情绑定数据
const nameResult = reactive({
  showEdit: false,
  tableData: [] as any[],
  name: "",
  selectRow: null,
  loading: false,
  treeConfig: {
    expandAll: true,
    expandRowKeys: [1],
    parentField: "parentId",
    children: "nextBomList"
  }
});
//品名详情按钮
const selectEvent = () => {
  nameResult.showEdit = true;
};

//双击品名详情操作
const cellDBLClickEvent: VxeTableEvents.CellDblclick = ({ row }) => {
  nameResult.selectRow = row;
};
//选择品名时的确定按钮
const schedueResultEvent = () => {
  console.log(nameResult.selectRow, "数据");
  if (nameResult.selectRow) {
    nameResult.showEdit = false;
    procedure.formData.bomName = nameResult.selectRow.name;
    procedure.formData.bomCode = nameResult.selectRow.code;
    procedure.formData.bomComId = nameResult.selectRow.id;
    procedure.treeName = nameResult.selectRow.name;
    procedure.treeCode = nameResult.selectRow.code;
    procedure.treeAnd =
      nameResult.selectRow.name + "(" + nameResult.selectRow.code + "）";
    procedure.treefigureNumber = nameResult.selectRow.figureNumber;
    procedure.treemodelNumber = nameResult.selectRow.modelNumber;
  } else {
    alertMessage("请选择物料", "提示");
  }
};
//品名取消
const selectClose = () => {
  nextTick(() => {
    nameResult.showEdit = false;
    nameResult.name = "";
    nameResult.tableData = [];
    nameResult.selectRow = null;
  });
};
//取消
const handleClose = () => {
  procedure.formData = {
    bnoConfimNum: 0,
    bnoNo: "",
    bomCode: "",
    bomName: "",
    custName: "",
    endWorkdConfimDate: "",
    endWorkdDate: "",
    productDeptName: "",
    startWorkDate: "",
    startWorkConfimDate: "",
    taskNo: "",
    id: 0,
    date: [],
    dateTime: [],
    priceUnit: "",
    bomComId: 0,
    modelNumber: "",
    figureNumber: ""
  };
  nextTick(() => {
    procedure.treeAnd = "";
    procedure.treefigureNumber = "";
    procedure.treemodelNumber = "";
    procedure.showEdit = false;
    searchEvent();
  });
};
const detailData = reactive({
  insertForm: {} as any,
  showEdit: false //显示隐藏
});
// 查看详情操作
const detailShow = (row: any) => {
  detailData.insertForm = row;
  console.log(detailData.insertForm);
  detailData.showEdit = true;
};
const detailClose = () => {
  detailData.showEdit = false;
  detailData.insertForm = {};
};
// 选择BOM
const chooseBomDialog = ref(false);
const chooseBomShow = () => {
  chooseBomDialog.value = true;
};
const chooseBomClose = () => {
  chooseBomDialog.value = false;
};

// 选择物料
const chooseMaterialDialog = ref(false);
const type = ref(1);
const chooseMaterialShow = num => {
  chooseMaterialDialog.value = true;
  type.value = num;
};
const chooseMaterialClose = () => {
  chooseMaterialDialog.value = false;
};
// 弹窗选择物料之后改变时的事件
const chooseTrue = (treeId, name, data) => {
  // workmanship.formData.taskNo
  console.log(name, data);
  // if (type.value == 1) {
  //   table.listQuery.bomId = data.id;
  //   table.listQuery.bomName = data.name;
  // }
  if (type.value == 2) {
    procedure.formData.bomName = data.name;
    procedure.formData.bomCode = data.code;
    procedure.formData.bomComId = data.id;
    procedure.treeName = data.name;
    procedure.treeCode = data.code;
    procedure.treeAnd = data.name + "(" + data.code + "）";
    procedure.treefigureNumber = data.figureNumber;
    procedure.treemodelNumber = data.modelNumber;
  }
};

// 异常完工
const completionAbnormal = async row => {
  const type = await VXETable.modal.confirm("您确定要异常完工吗？");
  if (type !== "confirm") {
    return;
  }
  reportTask(row.id)
    .then((res: any) => {
      if (res.code === 0) {
        successMessage("操作成功");
        searchEvent();
      } else {
        errorMessage(res.message);
      }
    })
    .catch(error => {
      errorMessage("操作失败");
    });
};

// 打印工序流转卡
const printProcessDialog = ref(false);
const printIds = ref([]);
const printProcessShow = () => {
  const $table = xTable.value;
  const checkboxRecords = $table.getCheckboxRecords();
  if (checkboxRecords.length == 0) {
    errorMessage("请选择需要打印的生产订单");
    return false;
  } else {
    let temp = checkboxRecords.every(v => {
      if (v.taskStatus == 1) {
        return true;
      } else {
        errorMessage("请选择未开始的生产订单");
        return false;
      }
    });
    if (temp) {
      printIds.value = [];
      checkboxRecords.map(function (item) {
        printIds.value.push(item.id);
      });
      printProcessDialog.value = true;
    }
  }
};
const print = (row: any) => {
  printIds.value = [row.id];
  printProcessDialog.value = true;
};

const printProcessClose = () => {
  printProcessDialog.value = false;
};
// 删除单据
const deleteData = async row => {
  const type = await VXETable.modal.confirm("您确定要删除该数据?");
  if (type === "confirm") {
    deletePo(row.prodOrderNo).then((res: any) => {
      if (res.code === 0) {
        searchEvent();
        successMessage("删除成功");
      } else {
        errorMessage(res.message);
      }
    });
  }
};
// mounted
onMounted(() => {
  nextTick(() => {
    searchEvent();
    getBnoNo();
    // getTeam();
    queryUnit("数量");
    queryOrderEvent("");
    const $table = xTable.value;
    const $toolbar = xToolbar.value;
    $table.connect($toolbar);
    table.tableHeight = changeHeight();
  });
});
</script>

<template>
  <div>
    <!-- 工具栏 -->
    <vxe-form :data="table.listQuery">
      <vxe-form-item title="销售单号">
        <template #default="{ data }">
          <vxe-input v-model="data.bnoNo" placeholder="销售单号"></vxe-input>
        </template>
      </vxe-form-item>
      <vxe-form-item title="任务编号">
        <template #default="{ data }">
          <vxe-input v-model="data.taskNo" placeholder="任务编号"></vxe-input>
        </template>
      </vxe-form-item>
      <vxe-form-item title="生产订单编号">
        <template #default="{ data }">
          <vxe-input
            v-model="data.prodOrderNo"
            placeholder="生产订单编号"
          ></vxe-input>
        </template>
      </vxe-form-item>
      <vxe-form-item field="bomName" title="品名">
        <template #default="{ data }">
          <vxe-input v-model.trim="data.bomName" placeholder="品名"></vxe-input>
        </template>
      </vxe-form-item>
      <vxe-form-item title="料号">
        <template #default="{ data }">
          <vxe-input v-model="data.bomCode" placeholder="料号"></vxe-input>
        </template>
      </vxe-form-item>
      <vxe-form-item title="顶级母件">
        <template #default="{ data }">
          <vxe-input
            v-model="data.topBomCodeOrName"
            placeholder="顶级母件"
          ></vxe-input>
        </template>
      </vxe-form-item>
      <vxe-form-item title="计划状态" field="planStatus">
        <template #default="{ data }">
          <el-select
            size="small"
            clearable
            v-model="data.planStatus"
            placeholder="请选择计划状态"
          >
            <el-option label="未排产" :value="1"> </el-option>
            <el-option label="已排产" :value="2"> </el-option>
          </el-select>
        </template>
      </vxe-form-item>
      <vxe-form-item title="开工状态" field="runningStatus">
        <template #default="{ data }">
          <el-select
            size="small"
            clearable
            v-model="data.runningStatus"
            placeholder="请选择开工状态"
          >
            <el-option label="未开工" :value="2"> </el-option>
            <el-option label="开工" :value="3"> </el-option>
          </el-select>
        </template>
      </vxe-form-item>
      <vxe-form-item title="调整后加工时间" field="date">
        <template #default="{ data }">
          <el-date-picker
            v-model="data.date"
            size="small"
            type="daterange"
            range-separator="至"
            start-placeholder="开始日期"
            end-placeholder="结束日期"
            clearable
          ></el-date-picker>
        </template>
      </vxe-form-item>
      <vxe-form-item>
        <template #default>
          <vxe-button
            icon="fa fa-search"
            status="primary"
            @click="searchEvent"
            v-auth="routeName + ':search'"
            >查询</vxe-button
          >
          <vxe-button
            icon="fa fa-plus"
            status="primary"
            @click="insertEvent"
            v-auth="routeName + ':add'"
            >新增</vxe-button
          >
          <vxe-button
            status="primary"
            icon="fa fa-columns"
            v-auth="routeName + ':issued'"
            @click="schedulingEvent"
            >排产</vxe-button
          >
          <!-- <vxe-button
            status="primary"
            icon="fa fa-hand-paper-o"
            v-auth="routeName + ':issued'"
            @click="startOrders"
            >开工</vxe-button
          > -->
          <!-- <vxe-button
            status="primary"
            icon="fa fa-reply"
            v-auth="routeName + ':reply'"
            @click="recallEvent"
            >撤回</vxe-button
          > -->
          <vxe-button
            status="primary"
            icon="fa fa-download"
            @click="upPlan"
            v-auth="routeName + ':export'"
            >导出数据</vxe-button
          >
          <vxe-button
            status="primary"
            icon="fa fa-print"
            @click="printProcessShow"
            v-auth="routeName + ':print'"
            >工序流转卡</vxe-button
          >
        </template>
      </vxe-form-item>
    </vxe-form>
    <!-- 列表 -->
    <vxe-toolbar ref="xToolbar" style="margin: 12px 0 -12px 0" custom>
    </vxe-toolbar>
    <vxe-table
      ref="xTable"
      class="mytable-style"
      border
      show-header-overflow
      show-overflow
      :row-config="{ isHover: true }"
      :print-config="{}"
      :export-config="{}"
      :height="table.tableHeight"
      :data="procedure.tableData"
    >
      <!-- :loading="table.loading" -->
      <vxe-column type="checkbox" id="label" width="40"></vxe-column>
      <vxe-column type="seq" title="序号" width="60"></vxe-column>
      <vxe-column field="bnoNo" title="销售单号" width="150"></vxe-column>
      <vxe-column
        field="custName"
        title="客户名称"
        min-width="150"
      ></vxe-column>
      <vxe-column field="taskNo" title="任务编号" width="110"></vxe-column>
      <vxe-column
        field="prodOrderNo"
        title="生产订单编号"
        min-width="180"
      ></vxe-column>
      <!-- 
      <vxe-column
        field="productDeptName"
        title="生产部门"
        width="80"
      ></vxe-column> -->
      <vxe-column field="bomCode" title="料号" min-width="130"></vxe-column>
      <vxe-column
        field="topBomCodeOrName"
        title="顶级母件"
        min-width="260"
      ></vxe-column>
      <vxe-column field="bomName" title="品名" width="240"></vxe-column>
      <vxe-column
        field="figureNumber"
        title="别名"
        min-width="150"
      ></vxe-column>
      <vxe-column field="modelNumber" title="机型" width="100"></vxe-column>
      <vxe-column field="startWorkDate" title="加工日期" width="100">
        <template #default="{ row }">
          {{ row.startWorkDate ? row.startWorkDate.split(" ")[0] : "" }}
        </template>
      </vxe-column>
      <vxe-column field="endWorkdDate" title="完工日期" width="100">
        <template #default="{ row }">
          {{ row.endWorkdDate ? row.endWorkdDate.split(" ")[0] : "" }}
        </template>
      </vxe-column>
      <vxe-column field="startWorkDate" title="调整后加工日期" width="120">
        <template #default="{ row }">
          {{
            row.startWorkConfimDate ? row.startWorkConfimDate.split(" ")[0] : ""
          }}
        </template>
      </vxe-column>
      <vxe-column field="endWorkdConfimDate" title="调整后完工日期" width="120">
        <template #default="{ row }">
          {{
            row.endWorkdConfimDate ? row.endWorkdConfimDate.split(" ")[0] : ""
          }}
        </template>
      </vxe-column>
      <vxe-column field="bnoConfimNum" title="数量" width="80"></vxe-column>
      <vxe-column field="priceUnit" title="单位" width="80"></vxe-column>
      <!-- <vxe-column field="bnoConfimNum" title="生产数量" width="80"></vxe-column> -->
      <!-- <vxe-column field="planStatus" title="生产订单状态" width="80">
        <template #default="{ row }">
          <el-tag type="warning" v-if="row.planStatus == 1">未排产</el-tag>
          <el-tag type="success" v-if="row.planStatus == 2">已排产</el-tag>
          <el-tag type="info" v-if="row.planStatus == 3">已撤销</el-tag>
          <el-tag type="danger" v-if="row.planStatus == 4">已推送</el-tag>
        </template>
      </vxe-column> -->
      <vxe-column field="planStatus" title="计划状态" width="90">
        <template #default="{ row }">
          <el-tag type="warning" v-if="row.planStatus == 1">未排产</el-tag>
          <el-tag type="success" v-if="row.planStatus == 2">已排产</el-tag>
          <!-- <el-tag type="info" v-if="row.planStatus == 3">已撤销</el-tag>
          <el-tag type="danger" v-if="row.planStatus == 4">已推送</el-tag> -->
        </template>
      </vxe-column>
      <vxe-column field="taskStatus" title="任务状态" width="90">
        <template #default="{ row }">
          <span v-if="row.isSuspend == 1 && row.taskStatus != 6">
            <el-tag type="info" effect="dark">暂停</el-tag>
          </span>
          <!-- <el-tag v-if="row.taskStatus == 6" type="danger" effect="dark"
            >终止</el-tag
          > -->
          <span v-else>
            <el-tag type="warning" effect="dark" v-if="row.taskStatus == 1"
              >未开始</el-tag
            >
            <el-tag type="success" effect="dark" v-if="row.taskStatus == 2"
              >已完成</el-tag
            >
            <el-tag type="info" effect="dark" v-if="row.taskStatus == 3"
              >暂停</el-tag
            >
            <el-tag type="danger" effect="dark" v-if="row.taskStatus == 4"
              >故障</el-tag
            >
            <el-tag type="success" effect="dark" v-if="row.taskStatus == 5"
              >进行中</el-tag
            >
            <el-tag type="danger" effect="dark" v-if="row.taskStatus == 6"
              >终止</el-tag
            >
          </span>
        </template>
      </vxe-column>
      <!-- v-show="row.planStatus != 2" -->
      <vxe-column title="操作" width="390" fixed="right">
        <template #default="{ row }">
          <vxe-button
            type="text"
            icon="fa fa-eye"
            @click="detailShow(row)"
            v-auth="routeName + ':edit'"
            v-if="row.runningStatus > 2 || row.taskStatus == 6"
            >查看</vxe-button
          >
          <vxe-button
            type="text"
            icon="fa fa-hand-paper-o"
            v-auth="routeName + ':pause'"
            v-show="row.runningStatus !== 2 || row.taskStatus == 3"
            @click="stopdEvent(row)"
            >终止</vxe-button
          >
          <!-- <span
            v-if="
              row.taskStatus == 6 ||
              row.runningStatus == 3 ||
              row.runningStatus == 4
            "
          ></span> -->
          <vxe-button
            type="text"
            icon="fa fa-exclamation-triangle"
            v-auth="routeName + ':pause'"
            @click="completionAbnormal(row)"
            v-if="row.taskStatus == 5 && row.isSuspend != 1"
            >异常完工</vxe-button
          >

          <span v-if="row.taskStatus == 1">
            <vxe-button
              v-show="row.runningStatus !== 3"
              type="text"
              icon="fa fa-edit"
              @click="editEvent(row)"
              v-auth="routeName + ':edit'"
              >编辑</vxe-button
            >
            <!-- <vxe-button
              type="text"
              icon="fa fa-hand-paper-o"
              @click="luckEvent(row)"
              v-auth="routeName + ':edit'"
              v-show="row.runningStatus == 2"
              >开工</vxe-button
            > -->
            <vxe-button
              type="text"
              icon="fa fa-thumbs-o-up"
              @click="finishEvent(row)"
              v-auth="routeName + ':edit'"
              v-show="row.taskStatus == 2 && row.isSuspend == 0"
              >完工</vxe-button
            >
            <vxe-button
              type="text"
              icon="fa fa-pause"
              v-auth="routeName + ':pause'"
              v-show="row.runningStatus !== 2 && row.isSuspend != 1"
              @click="suspendEvent(row)"
              >暂停</vxe-button
            >

            <vxe-button
              type="text"
              icon="fa fa-window-close-o"
              v-auth="routeName + ':pause'"
              @click="closeEvent(row)"
              v-show="row.isSuspend == 1"
              >恢复</vxe-button
            >
            <vxe-button
              type="text"
              icon="fa fa-print"
              @click="print(row)"
              v-auth="routeName + ':print'"
              >工序流转卡</vxe-button
            >
          </span>
          <vxe-button
            type="text"
            icon="fa fa-trash-o"
            v-auth="routeName + ':delete'"
            @click="deleteData(row)"
            >删除</vxe-button
          >
        </template>
      </vxe-column>
    </vxe-table>
    <!-- 分页 -->
    <vxe-pager
      perfect
      @page-change="handlePageChange"
      v-model:current-page="page.pageNum"
      v-model:page-size="page.pageRow"
      :total="page.totalResult"
      :page-sizes="[10, 20, 50, 100, 300, 1000, 3000, 5000]"
      :layouts="[
        'PrevJump',
        'PrevPage',
        'Number',
        'NextPage',
        'NextJump',
        'Sizes',
        'FullJump',
        'Total'
      ]"
    >
    </vxe-pager>
    <!-- 工序流转卡打印 -->
    <print-process
      :dialogShow="printProcessDialog"
      :printIds="printIds"
      @printProcessClose="printProcessClose"
    ></print-process>
    <!-- 表单弹框 -->
    <vxe-modal
      v-model="procedure.showEdit"
      :title="procedure.selectRow ? '编辑&保存' : '新增&保存'"
      width="600"
      min-width="400"
      height="80%"
      :loading="procedure.submitLoading"
      resize
      showFooter
      destroy-on-close
      @close="handleClose"
    >
      <template #default>
        <vxe-form
          ref="xForm"
          :data="procedure.formData"
          :rules="procedure.formRules"
          title-align="right"
          title-width="160"
        >
          <vxe-form-item field="bnoNo" title="销售单号" :span="24">
            <el-input
              v-model="procedure.formData.bnoNo"
              size="small"
            ></el-input>
          </vxe-form-item>
          <vxe-form-item field="custName" title="客户名称" :span="24">
            <customer-select
              v-model:value="procedure.formData.custName"
              valueType="name"
            />
          </vxe-form-item>
          <!-- <vxe-form-item field="taskNo" title="任务编号" :span="24">
            <el-input
              v-model="procedure.formData.taskNo"
              size="small"
            ></el-input> -->
          <!-- <template v-if="procedure.selectRow">
              {{ procedure.formData.taskNo }}
            </template>
            <el-select
              v-model="procedure.formData.taskNo"
              filterable
              size="small"
              placeholder="请选择任务编号"
              style="width: 100%"
              @keyup="queryOrderEvent(procedure.formData.taskNo)"
              @blur="queryOrderEvent(procedure.formData.taskNo)"
              @focus="queryOrderEvent(procedure.formData.taskNo)"
              @clear="queryOrderEvent('')"
              v-else
            >
              <el-option
                v-for="item in procedure.taskNoData"
                :key="item"
                :label="item.taskNos"
                :value="item.taskNo"
              >
              </el-option>
            </el-select> -->
          <!-- </vxe-form-item> -->
          <vxe-form-item field="bomCode" title="品名" :span="24">
            <template v-if="procedure.selectRow">
              {{ procedure.formData.bomName }}
            </template>
            <div class="codeStyle" v-else>
              <el-input
                readonly
                v-model="procedure.treeAnd"
                size="small"
              ></el-input>
              <el-button
                class="codeBtn"
                type="primary"
                @click="chooseMaterialShow(2)"
                size="small"
                >查找</el-button
              >
            </div>
          </vxe-form-item>
          <vxe-form-item field="figureNumber" title="别名" :span="24">
            <template v-if="procedure.selectRow">
              {{ procedure.formData.figureNumber }}
            </template>
            <el-input
              v-else
              readonly
              v-model="procedure.treefigureNumber"
              size="small"
            ></el-input>
          </vxe-form-item>
          <vxe-form-item field="modelNumber" title="机型" :span="24">
            <template v-if="procedure.selectRow">
              {{ procedure.formData.modelNumber }}
            </template>
            <el-input
              v-else
              readonly
              v-model="procedure.treemodelNumber"
              size="small"
            ></el-input>
          </vxe-form-item>
          <!-- <vxe-form-item title="加工日期" field="startWorkDate" :span="24">
            <template v-if="procedure.selectRow">
              {{
                procedure.formData.startWorkDate
                  ? procedure.formData.startWorkDate.split(" ")[0]
                  : ""
              }}
            </template>
            <el-date-picker
              style="width: 100%"
              size="small"
              v-model="procedure.formData.startWorkDate"
              type="date"
              clearable
              placeholder="选择日期"
              v-else
            ></el-date-picker>
          </vxe-form-item>
          <vxe-form-item title="完工日期" field="endWorkdDate" :span="24">
            <template v-if="procedure.selectRow">
              {{
                procedure.formData.endWorkdDate
                  ? procedure.formData.endWorkdDate.split(" ")[0]
                  : ""
              }}
            </template>
            <el-date-picker
              style="width: 100%"
              size="small"
              v-model="procedure.formData.endWorkdDate"
              type="date"
              clearable
              placeholder="选择日期"
              v-else
            ></el-date-picker>
          </vxe-form-item> -->
          <vxe-form-item
            title="调整后加工日期"
            field="startWorkConfimDate"
            :span="24"
          >
            <el-date-picker
              style="width: 100%"
              v-model="procedure.formData.startWorkConfimDate"
              type="date"
              clearable
              placeholder="选择日期"
              size="small"
            ></el-date-picker>
          </vxe-form-item>
          <vxe-form-item
            title="调整后完工日期"
            field="endWorkdConfimDate"
            :span="24"
          >
            <el-date-picker
              size="small"
              style="width: 100%"
              v-model="procedure.formData.endWorkdConfimDate"
              type="date"
              clearable
              placeholder="选择日期"
            ></el-date-picker>
          </vxe-form-item>
          <vxe-form-item field="bnoConfimNum" title="数量" :span="24">
            <el-input-number
              size="small"
              v-model="procedure.formData.bnoConfimNum"
              :precision="2"
              :step="1"
              :min="0"
              placeholder="请输入数量"
            ></el-input-number>
          </vxe-form-item>
          <vxe-form-item field="priceUnit" title="单位" :span="24">
            <template v-if="procedure.selectRow">
              {{ procedure.formData.priceUnit }}
            </template>
            <el-select
              v-model="procedure.formData.priceUnit"
              filterable
              size="small"
              placeholder="请选择单位"
              v-else
            >
              <el-option
                v-for="item in procedure.lengthData"
                :key="item.id"
                :label="item.unitName"
                :value="item.unitName"
              >
              </el-option>
            </el-select>
          </vxe-form-item>
        </vxe-form>
      </template>
      <template #footer>
        <vxe-button @click="handleClose">取 消</vxe-button>
        <vxe-button status="primary" @click="submitEvent">确 定</vxe-button>
      </template>
    </vxe-modal>
    <!-- 查看详情 -->
    <el-dialog
      v-model="detailData.showEdit"
      title="查看详情"
      width="600px"
      top="7vh"
      resize
      showFooter
      destroy-on-close
      :before-close="detailClose"
    >
      <template #default>
        <el-form
          id="dialogForm"
          :data="detailData.insertForm"
          label-align="right"
          label-width="160px"
        >
          <el-form-item prop="taskNo" label="任务编号">
            {{ detailData.insertForm.taskNo }}
          </el-form-item>
          <el-form-item prop="bomCode" label="品名">
            {{ detailData.insertForm.bomName }}
          </el-form-item>
          <el-form-item prop="figureNumber" label="别名">
            {{ detailData.insertForm.figureNumber }}
          </el-form-item>
          <el-form-item prop="modelNumber" label="机型">
            {{ detailData.insertForm.modelNumber }}
          </el-form-item>
          <el-form-item label="加工日期" prop="startWorkDate">
            {{
              detailData.insertForm.startWorkDate
                ? detailData.insertForm.startWorkDate.split(" ")[0]
                : ""
            }}
          </el-form-item>
          <el-form-item label="完工日期" prop="endWorkdDate">
            {{
              detailData.insertForm.endWorkdDate
                ? detailData.insertForm.endWorkdDate.split(" ")[0]
                : ""
            }}
          </el-form-item>
          <el-form-item label="调整后加工日期" prop="startWorkConfimDate">
            {{
              detailData.insertForm.startWorkConfimDate
                ? detailData.insertForm.startWorkConfimDate.split(" ")[0]
                : ""
            }}
          </el-form-item>
          <el-form-item label="调整后完工日期" prop="endWorkdConfimDate">
            {{
              detailData.insertForm.endWorkdConfimDate
                ? detailData.insertForm.endWorkdConfimDate.split(" ")[0]
                : ""
            }}
          </el-form-item>
          <el-form-item prop="bnoConfimNum" label="数量">
            {{ detailData.insertForm.bnoConfimNum }}
          </el-form-item>
          <el-form-item prop="priceUnit" label="单位">
            {{ detailData.insertForm.priceUnit }}
          </el-form-item>
        </el-form>
      </template>
      <template #footer>
        <el-button @click="detailClose" size="small">取 消</el-button>
      </template>
    </el-dialog>
    <!-- 排产之后返回code==10显示的弹窗 -->
    <el-dialog
      width="80%"
      top="5vh"
      title="警告"
      v-model="schedueResult.showEdit"
      :before-close="schedueResultClose"
      :close-on-click-modal="false"
    >
      <el-table
        stripe
        :data="schedueResult.tableData"
        border
        fit
        size="mini"
        highlight-current-row
        tooltip-effect="dark"
      >
        <el-table-column type="index" width="50" label="序号"></el-table-column>
        <el-table-column
          prop="prodOrderNo"
          label="生产订单编号"
        ></el-table-column>
        <el-table-column
          label="预计加工日期"
          prop="startWorkConfimDate"
        ></el-table-column>
        <el-table-column
          prop="endWorkdConfimDate"
          label="预计完工日期"
        ></el-table-column>
        <el-table-column
          label="排产开始日期"
          prop="minPlanDate"
        ></el-table-column>
        <el-table-column
          label="排产结束日期"
          prop="maxPlanDate"
        ></el-table-column>
      </el-table>
      <template #footer>
        <el-button @click="schedueResultClose" size="small">确 认</el-button>
      </template>
    </el-dialog>
    <!-- 品名弹框 -->
    <el-dialog
      width="80%"
      top="5vh"
      title="详情"
      v-model="nameResult.showEdit"
      :before-close="selectClose"
      :close-on-click-modal="false"
    >
      <el-form
        ref="insertForm"
        :model="procedure.formData"
        :rules="procedure.formRulesEl"
        label-width="100px"
      >
        <el-row :gutter="10">
          <el-col :span="24">
            <el-form-item label="BOM" prop="name">
              <el-input
                v-model="nameResult.name"
                @click="chooseBomShow"
                readonly
                size="small"
                class="input-with-select"
              >
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <vxe-table
        resizable
        show-overflow
        keep-source
        border
        ref="xTable"
        row-id="id"
        :row-config="{ isCurrent: true, isHover: true, keyField: 'id' }"
        :print-config="{}"
        :export-config="{}"
        :loading="nameResult.loading"
        :tree-config="nameResult.treeConfig"
        :edit-config="{ trigger: 'click', mode: 'row', showStatus: true }"
        :height="table.tableHeight"
        :data="nameResult.tableData"
        @cell-click="cellDBLClickEvent"
        @cell-dblclick="cellDBLClickEvent"
        max-height="600"
      >
        <vxe-column
          field="name"
          title="品名"
          tree-node
          width="400"
        ></vxe-column>
        <vxe-column field="code" title="料号" min-width="130"></vxe-column>
        <!-- <vxe-column field="processStepName"
                  title="工序名称"
                  min-width="100"></vxe-column> -->
        <vxe-column field="useNum" title="数量" width="120"></vxe-column>
        <vxe-column
          field="figureNumber"
          title="别名"
          min-width="120"
        ></vxe-column>
        <vxe-column field="modelNumber" title="机型" width="120"></vxe-column>
        <vxe-column
          field="bomType"
          title="财务分类"
          min-width="100"
        ></vxe-column>
        <vxe-column
          field="itemCategory"
          title="库存分类"
          width="120"
        ></vxe-column>
        <vxe-column
          field="deliveryState"
          title="交货状态"
          width="120"
        ></vxe-column>
        <vxe-column
          field="modelAttributes"
          title="形态属性"
          width="120"
        ></vxe-column>
        <!-- <vxe-column field="productLine" title="产品系列" width="120"></vxe-column> -->
        <vxe-column
          field="measureUnit"
          title="计量单位"
          width="120"
        ></vxe-column>
        <vxe-column
          field="assistMeasureUnit"
          title="辅计量单位"
          width="120"
        ></vxe-column>
        <vxe-column
          field="workingHours"
          title="标准加工工时(小时)"
          width="160"
        ></vxe-column>
        <vxe-column
          field="inspectionHours"
          title="检验工时(小时)"
          width="140"
        ></vxe-column>
        <vxe-column
          field="reviewHours"
          title="复审工时(小时)"
          width="140"
        ></vxe-column>
        <!-- <vxe-column field="texture" title="材质" min-width="120"></vxe-column> -->
        <vxe-column field="longt" title="长度(单位)" min-width="100">
          <template #default="{ row }">
            {{ row.longt
            }}{{
              row.longt && row.lengthUnitCN ? "(" + row.lengthUnitCN + ")" : ""
            }}
          </template>
        </vxe-column>
        <vxe-column field="width" title="宽度(单位)" min-width="100">
          <template #default="{ row }">
            {{ row.width
            }}{{
              row.width && row.widthUnitCN ? "(" + row.widthUnitCN + ")" : ""
            }}
          </template>
        </vxe-column>
        <vxe-column field="thickness" title="厚度/高度(单位)" min-width="140">
          <template #default="{ row }">
            {{ row.thickness
            }}{{
              row.thickness && row.thicknessUnitCN
                ? "(" + row.thicknessUnitCN + ")"
                : ""
            }}
          </template>
        </vxe-column>
        <vxe-column field="specification" title="规格" width="120"></vxe-column>
        <vxe-column field="weight" title="成本(单位)" width="100">
          <template #default="{ row }">
            {{ row.weight
            }}{{
              row.weight && row.weightUnitCN ? "(" + row.weightUnitCN + ")" : ""
            }}
          </template>
        </vxe-column>
        <vxe-column
          field="processRouteName"
          title="工艺路线"
          width="150"
        ></vxe-column>
        <vxe-column field="leadTime" title="采购周期(单位)" width="120">
          <template #default="{ row }">
            {{ row.leadTime
            }}{{
              row.leadTime && row.leadTimeUtil
                ? "(" + row.leadTimeUtil + ")"
                : ""
            }}
          </template>
        </vxe-column>
        <vxe-column field="fixNumber" title="定盘数" width="120"></vxe-column>
      </vxe-table>
      <template #footer>
        <el-button @click="selectClose" size="small">取 消</el-button>
        <el-button @click="schedueResultEvent" type="primary" size="small"
          >确 认</el-button
        >
      </template>
    </el-dialog>
    <!-- 弹框选择BOM -->
    <choose-bom
      :dialogShow="chooseBomDialog"
      @chooseBomClose="chooseBomClose"
      @searchEvent="queryBomSelect"
    ></choose-bom>
    <!-- 弹框选择物料 -->
    <choose-material
      :dialogShow="chooseMaterialDialog"
      @chooseMaterialClose="chooseMaterialClose"
      @searchEvent="chooseTrue"
    ></choose-material>
  </div>
</template>
<style scoped>
@import url("/@/style/dialog.css");
</style>
<style lang="scss" scoped>
.vxe-input + .vxe-button,
.vxe-input + .vxe-button--dropdown,
.vxe-button + .vxe-button,
.vxe-button + .vxe-button--dropdown {
  margin-left: 0;
}

.vxe-toolbar.size--medium {
  padding: 10px;
}

.vxe-table--render-default.size--medium {
  margin-top: 12px;
}

.vxe-button.size--medium.type--button {
  margin-left: 1em;
  height: 32px;
}

.text-model {
  &:hover {
    cursor: pointer;
  }
}
:deep(.el-date-editor.el-input__inner),
.el-form-item :deep(.el-date-editor.el-input),
.el-select,
.el-input-number {
  width: 100% !important;
}
.divSpan {
  margin-bottom: 20px;
  padding-right: 20px;
  font-weight: bold;
}
.codeStyle {
  display: flex;
}
.codeBtn {
  margin-left: 10px;
}
// .select-software {
//   & ::v-deep .is-disabled {
//     & ::placeholder {
//       color: #000000;
//     }
//   }
// }
// .select-software {
//   & ::v-deep .is-disabled placeholder {
//     color: #000000;
//   }
// }
// .select-software .is-disabled :deep(placeholder) {
//   color: #000000;
// }
// :deep(.select-software .is-disabled.el-input__inner placeholder) {
//   color: #000000;
// }
// .view-action-box :deep(input::ms-input-placeholder) {
//   color: #000000;
// }
// .el-select .select-trigger .is-disabled::placeholder {
//   color: #f00;
// }
</style>
